﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AAA.Base.Util
{
    public class SequenceNumberHelper
    {
        public static string GenerateSequence(long lSeed)
        {
            int iMod = 65535;
            long lCurrent = lSeed;
            long lCurrentSec = 0;
            string strSeq = "";

            while (lCurrent > 0)
            {
                lCurrentSec = lCurrent % iMod;
                lCurrent = (long)Math.Floor((float)lCurrent / iMod);
                strSeq += "-" + String.Format("{0:X}", lCurrentSec);
            }
            if (strSeq.Length > 0)
                strSeq = strSeq.Substring(1);

            return strSeq;
        }
    }
}
